﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Top.PointStore.Business;

namespace Top.PointStore.Business
{
    public class BrokerCarUtils
    {
        private static object _locker = new object();//锁对象
        private static BrokerCarInfo _brokerCarInfo = null;//约车设置信息
        private static string _dbfilepath = "/App_Data/brokercar.config";//设置信息文件路径

        public static BrokerCarInfo GetBrokerCarInfo()
        {
            if (_brokerCarInfo == null)
            {
                lock (_locker)
                {
                    if (_brokerCarInfo == null)
                    {
                        _brokerCarInfo =
                            (BrokerCarInfo)
                                IOHelper.DeserializeFromXML(typeof(BrokerCarInfo), IOHelper.GetMapPath(_dbfilepath));
                    }
                }
            }
            return _brokerCarInfo;
        }
    }
}
